home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / SHUFFLE.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  63 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   SHUFFLE .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. $INCLUDE "DAS-NB01.INC"
  22. COLOR 7, 0
  23. CLS
  24.  
  25. ? "┌────────────────────────────────────────────────────────────
  26. ? "│ ShuffleB ( Arr? (), First%, Last%, Load% )
  27. ? "│ ShuffleI ( Arr% (), First%, Last%, Load% )
  28. ? "│ ShuffleW ( Arr??(), First%, Last%, Load% )
  29. ? "├────────────────────────────────────────────────────────────────
  30. ? "│ These 3 iterations on a theme provide some excitement and mystery
  31. ? "│ to your programs.
  32. ? "│ If Load% is TRUE then the incoming array will have it's elements
  33. ? "│ loaded with consecutive numbers from First% to Last%
  34. ? "└─────────────────────────────────────────────────────────────────────────
  35.  
  36. RANDOMIZE TIMER
  37.  
  38. DIM P%(4), A$(4)
  39.  
  40. Q$    = "What is the capital of Illinois?"
  41. A$(1) = "Lincoln"
  42. A$(2) = "Chicago"
  43. A$(3) = "Springfield"
  44. A$(4) = "Peoria"
  45. ShuffleI P%(), 1, 4, -1
  46. PRINT
  47. PRINT Q$
  48. PRINT "  (1) "; A$( P%(1) )
  49. PRINT "  (2) "; A$( P%(2) )
  50. PRINT "  (3) "; A$( P%(3) )
  51. PRINT "  (4) "; A$( P%(4) )
  52. PRINT
  53. PRINT "Your answer, please: ";
  54.  
  55. DO
  56.   ClearKeyboard
  57.   WHILE NOT INSTAT : WEND
  58.   G$ = INKEY$
  59. LOOP UNTIL ( G$ => "1" ) AND ( G$ =< "4" )
  60. PRINT G$
  61. A? = VAL( G$ )
  62. IF P%( A? ) = 3 THEN PRINT "CORRECT!" ELSE PRINT "WRONG"
  63.